#ifndef __W25Q16_H__
#define __W25Q16_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "main.h"
#define READ_DEVICE_ID			0x90
#define READ_STATUS_REG			0x05

#define WRITE_ENABLE			0x06
#define SECTOR_ERASE_4K			0x20
#define READ_DATA				0x03
#define PAGE_PROGRAM			0x02

#define W25QXX_PAGE_SIZE		256
#define W25QXX_SECTOR_SIZE		4096

void W25QXX_Init(void);
void W25QXX_Write(uint32_t address, uint8_t *pBuf, uint32_t length);
void W25QXX_Read(uint32_t address, uint8_t *pBuf, uint32_t length);
void W25QXX_EraseSector(uint32_t address);

#ifdef __cplusplus
}
#endif

#endif
